import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            name: '/',
            redirect: 'login'
        },
        {
            path: '/login',
            name: 'login',
            component: (resolve) => require (['@/components/login'], resolve)

        },        
        {
            path: '/home',
            component: (resolve) => require (['@/App'], resolve),
            redirect: '/home',
            children: [
                {
                    path: '/home',
                    name: 'home',
                    component: (resolve) => require (['@/components/home'], resolve)
        
                },
                {
                    path: '/task',
                    component: (resolve) => require (['@/components/task'], resolve),
                    children: [
                        {
                            path: '',
                            name: 'untreated',
                            component: (resolve) => require(['@/components/task/untreated'], resolve),
                            children: [
                            ]
                        },
                        {
                            path: 'processed',
                            name: 'processed',
                            component: (resolve) => require(['@/components/task/processed'], resolve)
                        },
                        {
                            path: 'detail',
                            name: 'detail',
                            component: (resolve) => require(['@/components/task/parts/detail'], resolve)
                        }
                    ]
        
                },                
                {
                    path: '/createGrid',
                    name: 'createGrid',
                    component: (resolve) => require (['@/components/createGrid/createGrid'], resolve)
                }              
            ]

        }
    ]
});
